package com.weseal.controller.base;

import com.weseal.query.PageQuery;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.servlet.NoHandlerFoundException;

import javax.servlet.ServletException;

/**
 * @author weseal
 * @title
 * @description
 * @usage
 * @copyright Copyright 2014  rrmj Corporation. All rights reserved.
 * @company 上海众多美网络科技有限公司
 * @create 2017/9/15
 */
@ControllerAdvice
public class NoHandlerFoundControllerAdvice {

	@ExceptionHandler(NoHandlerFoundException.class)
	public String handleNoHandlerFoundException(NoHandlerFoundException ex) {
		// prepare responseEntity
		return "common/404";
	}

	@ExceptionHandler(ServletException.class)
	public String servletException(ServletException ex) {
		return "common/404";
	}

}
